I am getting this issue in sonar. I don't know why it's giving this issue.
The code is:
for(let k=0; k<this.side_list.length; ++k){
if(this.allowedPageList.indexOf(this.side_list[k].route) === -1){
this.side_list.splice(k,1); --k;
}else{
if(this.side_list[k].children?.length > 0){
for(let l=0; l<this.side_list[k].children.length; ++l){
if(this.allowedPageList.indexOf(this.side_list[k].children[l].route) === -1){
this.side_list[k].children.splice(l,1); --l;
}
}
}
}
}
Can somebody please help me fix this issue? Is sonar asking me to remove --k and --l from the code? But that can then disrupt the function.